.class public Lcom/sina/weibo/sdk/a/b;
.super Ljava/lang/Object;


# instance fields
.field private a:Landroid/content/Context;

.field private b:Lcom/sina/weibo/sdk/a/c;


# direct methods
.method private b(Lcom/sina/weibo/sdk/a/d;I)V
    .locals 4

    if-nez p1, :cond_0

    :goto_0
    return-void

    :cond_0
    new-instance v0, Lcom/sina/weibo/sdk/net/b;

    invoke-direct {v0}, Lcom/sina/weibo/sdk/net/b;-><init>()V

    const-string v1, "client_id"

    iget-object v2, p0, Lcom/sina/weibo/sdk/a/b;->b:Lcom/sina/weibo/sdk/a/c;

    invoke-static {v2}, Lcom/sina/weibo/sdk/a/c;->a(Lcom/sina/weibo/sdk/a/c;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/sina/weibo/sdk/net/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    const-string v1, "redirect_uri"

    iget-object v2, p0, Lcom/sina/weibo/sdk/a/b;->b:Lcom/sina/weibo/sdk/a/c;

    invoke-static {v2}, Lcom/sina/weibo/sdk/a/c;->b(Lcom/sina/weibo/sdk/a/c;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/sina/weibo/sdk/net/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    const-string v1, "scope"

    iget-object v2, p0, Lcom/sina/weibo/sdk/a/b;->b:Lcom/sina/weibo/sdk/a/c;

    invoke-static {v2}, Lcom/sina/weibo/sdk/a/c;->c(Lcom/sina/weibo/sdk/a/c;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/sina/weibo/sdk/net/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    const-string v1, "response_type"

    const-string v2, "code"

    invoke-virtual {v0, v1, v2}, Lcom/sina/weibo/sdk/net/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    const-string v1, "display"

    const-string v2, "mobile"

    invoke-virtual {v0, v1, v2}, Lcom/sina/weibo/sdk/net/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    const/4 v1, 0x1

    if-ne v1, p2, :cond_1

    const-string v1, "packagename"

    iget-object v2, p0, Lcom/sina/weibo/sdk/a/b;->b:Lcom/sina/weibo/sdk/a/c;

    invoke-static {v2}, Lcom/sina/weibo/sdk/a/c;->d(Lcom/sina/weibo/sdk/a/c;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/sina/weibo/sdk/net/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    const-string v1, "key_hash"

    iget-object v2, p0, Lcom/sina/weibo/sdk/a/b;->b:Lcom/sina/weibo/sdk/a/c;

    invoke-static {v2}, Lcom/sina/weibo/sdk/a/c;->e(Lcom/sina/weibo/sdk/a/c;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/sina/weibo/sdk/net/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    :cond_1
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "https://open.weibo.cn/oauth2/authorize?"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Lcom/sina/weibo/sdk/net/b;->a()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/sina/weibo/sdk/a/b;->a:Landroid/content/Context;

    invoke-static {v1}, Lcom/sina/weibo/sdk/c/c;->a(Landroid/content/Context;)Z

    move-result v1

    if-nez v1, :cond_2

    iget-object v0, p0, Lcom/sina/weibo/sdk/a/b;->a:Landroid/content/Context;

    const-string v1, "Error"

    const-string v2, "Application requires permission to access the Internet"

    invoke-static {v0, v1, v2}, Lcom/sina/weibo/sdk/c/f;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    :cond_2
    iget-object v1, p0, Lcom/sina/weibo/sdk/a/b;->a:Landroid/content/Context;

    invoke-static {v1}, Lcom/sina/weibo/sdk/c/c;->b(Landroid/content/Context;)Z

    move-result v1

    if-eqz v1, :cond_3

    new-instance v1, Lcom/sina/weibo/sdk/a/e;

    iget-object v2, p0, Lcom/sina/weibo/sdk/a/b;->a:Landroid/content/Context;

    invoke-direct {v1, v2, v0, p1, p0}, Lcom/sina/weibo/sdk/a/e;-><init>(Landroid/content/Context;Ljava/lang/String;Lcom/sina/weibo/sdk/a/d;Lcom/sina/weibo/sdk/a/b;)V

    invoke-virtual {v1}, Lcom/sina/weibo/sdk/a/e;->show()V

    goto/16 :goto_0

    :cond_3
    iget-object v0, p0, Lcom/sina/weibo/sdk/a/b;->a:Landroid/content/Context;

    const/4 v1, 0x2

    invoke-static {v0, v1}, Lcom/sina/weibo/sdk/c/d;->a(Landroid/content/Context;I)Ljava/lang/String;

    move-result-object v0

    const-string v1, "Weibo_web_login"

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "String: "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/sina/weibo/sdk/c/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v1, p0, Lcom/sina/weibo/sdk/a/b;->a:Landroid/content/Context;

    const/4 v2, 0x0

    invoke-static {v1, v0, v2}, Lcom/sina/weibo/sdk/c/f;->a(Landroid/content/Context;Ljava/lang/CharSequence;I)V

    goto/16 :goto_0
.end method


# virtual methods
.method public a()Lcom/sina/weibo/sdk/a/c;
    .locals 1

    iget-object v0, p0, Lcom/sina/weibo/sdk/a/b;->b:Lcom/sina/weibo/sdk/a/c;

    return-object v0
.end method

.method public a(Lcom/sina/weibo/sdk/a/d;)V
    .locals 1

    const/4 v0, 0x1

    invoke-virtual {p0, p1, v0}, Lcom/sina/weibo/sdk/a/b;->a(Lcom/sina/weibo/sdk/a/d;I)V

    return-void
.end method

.method public a(Lcom/sina/weibo/sdk/a/d;I)V
    .locals 0

    invoke-direct {p0, p1, p2}, Lcom/sina/weibo/sdk/a/b;->b(Lcom/sina/weibo/sdk/a/d;I)V

    return-void
.end method
